package it.polimi.traveldream.ejb;

import it.polimi.traveldream.dto.UserDTO;
import it.polimi.traveldream.entity.Customer;

import javax.annotation.Resource;
import javax.ejb.EJBContext;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class UserManagerBean implements UserManager {

	@PersistenceContext
	private EntityManager em;

	@Resource
	private EJBContext context;

	@Override
	public void save(UserDTO user) {
		Customer newCustomer = new Customer(user);
		this.em.persist(newCustomer);
	}

}
